package com.entity;

import com.annotation.ColumnInfo;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 评分信息
 */
@TableName("ratings")
public class MeishiRatingEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    @ColumnInfo(comment="主键", type="int(11)")
    @TableField(value = "id")
    private Integer id;

    /**
     * 用户ID
     */
    @ColumnInfo(comment="用户ID", type="int(11)")
    @TableField(value = "user_id")
    private Integer userId;

    /**
     * 物品ID
     */
    @ColumnInfo(comment="物品ID", type="int(11)")
    @TableField(value = "item_id")
    private Integer itemId;

    /**
     * 物品类型
     */
    @ColumnInfo(comment="物品类型", type="varchar(50)")
    @TableField(value = "item_type")
    private String itemType;

    /**
     * 评分
     */
    @ColumnInfo(comment="评分", type="decimal(3,2)")
    @TableField(value = "rating")
    private Double rating;

    /**
     * 创建时间
     */
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat
    @ColumnInfo(comment="创建时间", type="datetime")
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private Date createdAt;

    // 构造方法、getter、setter、toString 可自动生成
}